#include <mpi.h>
#include <stdio.h>

#include "utils.h"


int add_matrix(struct matrix_t* a, struct matrix_t* b);

int main(int argc, char** argv)
{
	struct MPI_Info info;
	struct matrix_t* mat;
	struct matrix_t* smat;
	int i, j;

	MPI_Init(&argc, &argv);

	get_mpi_info(&info);
	read_matrix("A.txt", &mat);
	read_matrix("B.txt", &smat);

	printf("[m=%ld, n=%ld]\n", mat->m, mat->n);
	for (i = 0; i < mat->m; ++i) {
		for (j = 0; j < mat->n; ++j) {
			printf("%ld\t", get_elem(mat, i, j));
		}
		printf("\n");
	}

	MPI_Barrier(MPI_COMM_WORLD);
	MPI_Finalize();

	return 0;
}
